#include "TCPServer.hpp"
#include "ThreadPool.hpp"
#include "TCPConnection.hpp"
#include "BusinessService.hpp"
#include "Mylogger.hpp"
#include "Message.hpp"
#include <iostream>

using std::cout;
using std::endl;



namespace cdm{

class EchoServer{

public:
    EchoServer(uint16_t port,const string ip,int thd,int taskSize);

    ~EchoServer(){}
    void start();
    void stop();

private:
    void onConnected(TCPConnectionPtr conn);

    void onMessage(TCPConnectionPtr conn);

    void onClose(TCPConnectionPtr conn);

private:

    TCPServer   _server;
    ThreadPool  _thdpool;

};
}

/* int main(){ */
    
/*     cdm::EchoServer ecServer(8088,"0.0.0.0",4,10); */
/*     ecServer.start(); */

/*     return 0; */
/* } */


